package ch09;

import java.text.DecimalFormat;

class _45_DecimalFormatEx1 {
	public static void main(String[] args) throws Exception {
		double number = 1234567.89;

		String[] pattern = { "0", "#", "0.0", "#.#", "0000000000.0000",
				"##########.####", "#.#-", "-#.#", "#,###.##", "#,####.##",
				"#E0", "0E0", "##E0", "00E0", "####E0", "0000E0", "#.#E0",
				"0.0E0", "0.000000000E0", "00.00000000E0", "000.0000000E0",
				"#.#########E0", "##.########E0", "###.#######E0",
				"#,###.##+;#,###.##-", "#.#%", "#.#\u2030", "\u00A4 #,###",
				"'#'#,###", "''#,###", };

		for (int i = 0; i < pattern.length; i++) {
			DecimalFormat df = new DecimalFormat(pattern[i]);
			System.out.printf("%19s : %s\n", pattern[i], df.format(number));
		}
	}
}
/*
0 : 1234568
# : 1234568
0.0 : 1234567.9
#.# : 1234567.9
0000000000.0000 : 0001234567.8900
##########.#### : 1234567.89
#.#- : 1234567.9-
-#.# : -1234567.9
#,###.## : 1,234,567.89
#,####.## : 123,4567.89
#E0 : .1E7
0E0 : 1E6
##E0 : 1.2E6
00E0 : 12E5
####E0 : 123.5E4
0000E0 : 1235E3
#.#E0 : 1.2E6
0.0E0 : 1.2E6
0.000000000E0 : 1.234567890E6
00.00000000E0 : 12.34567890E5
000.0000000E0 : 123.4567890E4
#.#########E0 : 1.23456789E6
##.########E0 : 1.23456789E6
###.#######E0 : 1.23456789E6
#,###.##+;#,###.##- : 1,234,567.89+
#.#% : 123456789%
#.#‰ : 1234567890‰
¤ #,### : ￦ 1,234,568
'#'#,### : #1,234,568
''#,### : '1,234,568
*/